package cn.tedu._04mybatis;

import cn.tedu._04mybatis.mapper.CommentMapper;
import cn.tedu._04mybatis.pojo.entity.Comment;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Date;

@SpringBootTest
class ApplicationTest1 {
    @Autowired
    private CommentMapper commentMapper;
//    @Test
    void insertComment(){
        Comment comment=new Comment();
        comment.setContent("小黑子不准吃我家哥哥的蛋");
        comment.setCreated(new Date());
        comment.setUserId(100L);
        comment.setWeiboId(200L);
        commentMapper.insert(comment);
    }
//    @Test
    void deleteById(){
        System.out.println(commentMapper.delete(305L));
    }
//    @Test
    void selectCommentById(){
        System.out.println(commentMapper.select(300L));
    }
//    @Test
    void selectAllWeiBoById(){
        System.out.println(commentMapper.selectByweiboId(200L));
    }

}
